package com.tutu.sys.entity;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.time.DateFormatUtils;

import com.fasterxml.jackson.annotation.JsonProperty;

public class SysMsgUser implements Serializable {
    private String userMsgId;

    private String msgId;

    private String receiver;

    private Date viewDate;

    private String aliveFlag;

    private String creator;

    private Date createTime;

    private String modifier;

    private Date modifyTime;
    
    private SysMsgInstation sysMsgInstation;

    private static final long serialVersionUID = 1L;

    public String getUserMsgId() {
        return userMsgId;
    }

    public void setUserMsgId(String userMsgId) {
        this.userMsgId = userMsgId == null ? null : userMsgId.trim();
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId == null ? null : msgId.trim();
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver == null ? null : receiver.trim();
    }

    public Date getViewDate() {
        return viewDate;
    }

    public void setViewDate(Date viewDate) {
        this.viewDate = viewDate;
    }
    
    public boolean getIsView(){
    	if(viewDate==null){
    		return false;
    	}
    	return true;
    }

    public String getAliveFlag() {
        return aliveFlag;
    }

    public void setAliveFlag(String aliveFlag) {
        this.aliveFlag = aliveFlag == null ? null : aliveFlag.trim();
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator == null ? null : creator.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    @JsonProperty("createFormatTime")
    public String getCreateFormatTime() {
    	if(null!=createTime)
    		return DateFormatUtils.format(createTime, "yyyy-MM-dd");
        return "";
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier == null ? null : modifier.trim();
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysMsgUser other = (SysMsgUser) that;
        return (this.getUserMsgId() == null ? other.getUserMsgId() == null : this.getUserMsgId().equals(other.getUserMsgId()))
            && (this.getMsgId() == null ? other.getMsgId() == null : this.getMsgId().equals(other.getMsgId()))
            && (this.getReceiver() == null ? other.getReceiver() == null : this.getReceiver().equals(other.getReceiver()))
            && (this.getViewDate() == null ? other.getViewDate() == null : this.getViewDate().equals(other.getViewDate()))
            && (this.getAliveFlag() == null ? other.getAliveFlag() == null : this.getAliveFlag().equals(other.getAliveFlag()))
            && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getModifier() == null ? other.getModifier() == null : this.getModifier().equals(other.getModifier()))
            && (this.getModifyTime() == null ? other.getModifyTime() == null : this.getModifyTime().equals(other.getModifyTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserMsgId() == null) ? 0 : getUserMsgId().hashCode());
        result = prime * result + ((getMsgId() == null) ? 0 : getMsgId().hashCode());
        result = prime * result + ((getReceiver() == null) ? 0 : getReceiver().hashCode());
        result = prime * result + ((getViewDate() == null) ? 0 : getViewDate().hashCode());
        result = prime * result + ((getAliveFlag() == null) ? 0 : getAliveFlag().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getModifier() == null) ? 0 : getModifier().hashCode());
        result = prime * result + ((getModifyTime() == null) ? 0 : getModifyTime().hashCode());
        return result;
    }

	public SysMsgInstation getSysMsgInstation() {
		return sysMsgInstation;
	}

	public void setSysMsgInstation(SysMsgInstation sysMsgInstation) {
		this.sysMsgInstation = sysMsgInstation;
	}
    
}